<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<!-- #include virtual=/inc/action.header.inc.asp -->

<%
	'## 파라미터 변수 선언부
	
	SQLTitle = "-- ■■■■ 공지사항 정보 콤보 ■■■■"
	
	'## 검색조건에 따른 조건절 만들기 

	SQL = "SELECT TOP 3 seq, titles, CONVERT(varchar(21), issueDt, 121) wDate  FROM tblBoard WHERE flag='Y' AND noticeFlag='Y' AND startDt<='" & Date() & "' AND endDt >= '" & Date() & "' ORDER BY seq DESC" 

	If xMode="debug" Then 
		Call showDebug(SQLTitle,SQL) 
	End If 

	Set Rs=Server.CreateObject("ADODB.RecordSet")
	Rs.open SQL, DbCon, 1
	
	Response.write "<Notice>" & vbcrlf

	If Rs.eof Or Rs.bof Then 
	Else 
		Do Until Rs.eof Or Rs.bof
		
			wdate = rs("wDate")
			curDate = Date()
			dateOnly = Left(wdate,10)
			If curDate = dateOnly Then 
				wDt = Mid(wDate,12,5)
			Else
				wDt = Mid(wDate,6,5)
				wDt = Replace(wDt,"-","/")
			End If 
			Response.write "	<TopNotice>" & vbcrlf
				Call mkXMLNode("seq", rs("seq"), 2)
				Call mkXMLNode("titles", rs("titles"), 2)
				Call mkXMLNode("wdate", wDt, 2)
			Response.write "	</TopNotice>" & vbcrlf

		Rs.movenext
		Loop 
	End If
	Response.write "</Notice>" & vbcrlf
'	Call rsWithXML("Save OK!")
%>